﻿@inherits Umbraco.Web.Mvc.UmbracoTemplatePage

@using Tonus.Models

@{
    Layout = "Shared/tonusMedLayout.cshtml";
    var pageTitle = string.IsNullOrWhiteSpace(CurrentPage.Title)
       ? CurrentPage.Name
       : CurrentPage.Title;

    var gmapLocation = Model.Content.GetPropertyValue<GMapsLocation>("maplocation");
}

<div id="main-wrapper">
    <div id="main" class="container">
        <div class="row">
            <div class="12u skel-cell-mainContent">
                <header>
                    <h2>@pageTitle</h2>
                </header>
                <div id="mapCanvas" style="width:100%; height:500px;"></div>
                <div class="6u" style="margin-top:50px;">
                    <article class="is-page-content">
                        <section>
                            @Umbraco.Field("contactsinformation")
                        </section>
                    </article>
                </div>
                <div class="6u" style="margin-top:50px;">
                    <div class="emailForm">
                        @Html.Partial("ContactForm", new ContactFormModel())
                    </div>
                </div>
                <script src="http://maps.googleapis.com/maps/api/js?key=AIzaSyBRnDjukkY6ATsiEMwsO2haNOH09ZXAkE4&sensor=false"></script>
                <script type="text/javascript">

                    var map = null;
                    var propertyLat = '@gmapLocation.Lat';
                    var propertyLng = '@gmapLocation.Lng';

                    function initialize() {
                        var mapOptions = {
                            center: new google.maps.LatLng(propertyLat, propertyLng),
                            zoom: 17
                        };

                        map = new google.maps.Map(document.getElementById('mapCanvas'), mapOptions);

                        if (propertyLat && propertyLng) {
                            var latlng = new google.maps.LatLng(propertyLat, propertyLng);

                            var marker = new google.maps.Marker({
                                position: latlng,
                                map: map,
                                draggable: false,
                                icon: "http://maps.google.com/mapfiles/ms/micons/blue.png"
                            });

                        }
                    }
                    google.maps.event.addDomListener(window, 'load', initialize);

                </script>
            </div>
        </div>
    </div>
</div>